<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>
<%@ include file="../inc/topo.jsp" %>
    <div id="breadcrumb">
        <s:text name="label.breadcrumb" />
        
        <a href="listarPagina.action">
            <s:text name="pagina.nome" />
        </a>  
        <s:text name="breadcrumb.separador" />
        <s:url id="voltar" action="listarPagina.action">
            <s:param name="pagina.nuPagina" value="pagina.nuPagina" />
        </s:url>
        
        <a href="listarConteudo.action?pagina.nuPagina=${conteudo.nuPagina}">
        <s:text name="conteudo.nome" />
        </a> <s:text name="breadcrumb.separador" /><s:text name="label.atualizar" /><s:text name="conteudo.nome" />
    </div>
    <br/><h1><s:text name="label.atualizar" /><s:text name="conteudo.nome" /></h1>
    <br/><a href="listarConteudo.action"><b><s:text name="label.voltar" /></b></a>
    <s:if test="conteudo">
        <s:url id="lnkItemConteudo" action="listarItensConteudo">
            <s:param name="conteudo.nuConteudo" value="conteudo.nuConteudo"></s:param>
        </s:url>
    | <s:a href="%{lnkItemConteudo}"><b>Itens</b></s:a>
    </s:if>
    <br />
    <%@ include file="../inc/mensagens.jsp" %>
    <s:form action="editarConteudo" validate="true">
        <s:hidden name="conteudo.nuConteudo" />
         <div class="TbLEdit_row">
            <label for="nome">
                <s:text name="conteudo.nome" />:
            </label>
            <s:textfield name="conteudo.noConteudo" id="nome" accesskey="e" />
        </div>
        <div class="TbLEdit_row">
            <label for="cabecalhoForm">
                <s:text name="label.cabecalho" />:
            </label>
            <s:textarea name="conteudo.deCabecalho" id="cabecalhoForm" />
        </div>
        <div class="TbLEdit_row">
            <label for="TipoOrdenacao">
                Ordenar:
            </label>
            <select name="conteudo.nuTipoOrdenacao" id="TipoOrdenacao">
             <option value="3" ${(conteudo.nuTipoOrdenacao == 3 || empty conteudo.nuTipoOrdenacao)?'selected="selected"' :''}><s:text name="label.data.publicacao"/></option>
                <option value="1" ${(conteudo.nuTipoOrdenacao == 1)?'selected="selected"' :''}><s:text name="label.por.titulo"/></option>
                <option value="2" ${(conteudo.nuTipoOrdenacao == 2)?'selected="selected"' :''}><s:text name="label.id"/></option>            
                <option value="4" ${(conteudo.nuTipoOrdenacao == 4)?'selected="selected"' :''}><s:text name="label.manual"/></option>
            </select>
        </div>            
        <div class="TbLEdit_row">
            <label for="ordem">
                Ordem:
            </label>
            <select name="conteudo.coOrdemDecrescente" id="ordem">
                <option value="false">Crescente</option>
                <s:if test="%{conteudo.coOrdemDecrescente}">
                    <option value="true" selected="selected">Decrescente</option>
                </s:if>
                <s:if test="%{!conteudo.coOrdemDecrescente}">
                    <option value="true" >Decrescente</option>
                </s:if>
            </select>
        </div>
        <div class="TbLEdit_row">
            <label for="pagina"><s:text name="pagina.nome" />:</label>
            <s:select name="conteudo.nuPagina" id="pagina"
                list="listPagina"
                listKey="nuPagina"
                listValue="noTitulo"
            />
        </div>
        <div class="TbLEdit_row">
            <label for="nu_tipo_conteudo"><s:text name="tipo_de_conteudo.nome" />:</label>
            <s:select name="conteudo.nuTipoConteudo" id="nu_tipo_conteudo"
                list="listTipoConteudo"
                listKey="nuTipoConteudo"
                listValue="noTipoConteudo"
            />
        </div>
        <div class="TbLEdit_btns">
            <s:submit name="btnGravar" key="button.label.atualizar" accesskey="s" /> <s:reset name="reset" key="button.label.limpar"/>
        </div>
    </s:form>
    <jsp:include page="../inc/final.jsp" />
